home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / listings / v_09_06 / 9n06092a < prev    next >
Text File  |  1990-08-29  |  3KB  |  88 lines

  1.  
  2.      while(not_finished){
  3.  
  4.         show_menu();
  5.  
  6.         get_integer(&response);
  7.  
  8.         switch (response){
  9.  
  10.         case 1:/* display image header */
  11.          get_image_name(name);
  12.          read_tiff_header(name, &image_header);
  13.          printf("\n\nCIPS> The image header is:");
  14.          printf("\n\t\twidth=%ld length=%ld  start=%ld  bits=%ld",
  15.               image_header.image_width,
  16.               image_header.image_length,
  17.               image_header.strip_offset,
  18.               image_header.bits_per_pixel);
  19.          printf("\nCIPS> Hit Enter to continue");
  20.          read_string(rep);
  21.          break;
  22.  
  23.         case 2:/* display image numbers */
  24.          get_image_name(name);
  25.          get_parameters(&il, &ie, &ll, &le);
  26.          read_tiff_image(name, the_image, il, ie, ll, le);
  27.          show_image(the_image, il, ie);
  28.          break;
  29.  
  30.         case 3:   /* print image numbers */
  31.          get_image_name(name);
  32.          get_parameters(&il, &ie, &ll, &le);
  33.          read_tiff_image(name, the_image, il, ie, ll, le);
  34.          print_image(the_image, name, 1, 1, 1, 100, 18,
  35.                      il, ie);
  36.          break;
  37.  
  38.         case 4:   /* display image */
  39.          get_image_name(name);
  40.          read_tiff_header(name, &image_header);
  41.          get_parameters(&il, &ie, &ll, &le);
  42.          display_menu_for_display_image(&image_colors,
  43.                    &display_colors, &invert,
  44.                    color_transform, monitor_type);
  45.          display_image(name, the_image, il, ie,
  46.                    ll, le, &image_header, monitor_type,
  47.                    color_transform, invert,
  48.                    image_colors, display_colors);
  49.          break;
  50.  
  51.         case 5:   /* display image using halftoning */
  52.          get_image_name(name);
  53.          read_tiff_header(name, &image_header);
  54.          get_parameters(&il, &ie, &ll, &le);
  55.          display_menu_for_display_image(&image_colors,
  56.                    &display_colors, &invert,
  57.                    color_transform, monitor_type);
  58.          get_threshold_value(&threshold, &print);
  59.          display_using_halftoning(the_image, name,
  60.                    il, ie, ll, le, threshold,
  61.                    invert, image_colors, &image_header,
  62.                    monitor_type, print);
  63.       break;
  64.  
  65.      case 6:   /* print graphics image */
  66.       get_image_name(name);
  67.          read_tiff_header(name, &image_header);
  68.          get_parameters(&il, &ie, &ll, &le);
  69.          display_menu_for_display_image(&image_colors,
  70.                    &display_colors, &invert,
  71.             color_transform, monitor_type);
  72.       get_graphics_caption(caption);
  73.       print_graphics_image(the_image, out_image, name,
  74.             il, ie, ll, le, image_colors,
  75.             invert, caption);
  76.       break;
  77.  
  78.         case 20:  /* exit system */
  79.          not_finished = 0;
  80.          break;
  81.  
  82.         default:
  83.          printf("\nCould not understand response, try again");
  84.          break;
  85.  
  86.      }               /* ends switch response          */
  87.   }               /* ends while not finished */
  88.